package com.miracle9.game.dao;

import com.miracle9.game.entity.LiKuiFishRoom;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

@Repository
public class LiKuiFishRoomDao extends SqlOperating<LiKuiFishRoom, Integer> {

    @CacheEvict(value = {"springCache"}, key = "'getLiKuiFishRoomById'+#id")
    public void updateDeskNumById(int deskNum, int id) {
        String hql = "update LiKuiFishRoom set deskNum = deskNum + ? where id = ?";
        q_CreateSql(hql, new Object[]{deskNum, id}).executeUpdate();
    }

    @Cacheable(value = {"springCache"}, key = "'getLiKuiFishRoomById'+#id")
    public LiKuiFishRoom getById(int id) {
        return (LiKuiFishRoom) getById(Integer.valueOf(id));
    }

}

